#include <iostream>
#include <string>
#include <vector>       //vector<bool>
#include <iterator>
#include <algorithm>
#include <sstream>
#include <limits>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>      //strlen()
#include <climits>      //ULONG_MAX
#include <cmath>      //ULONG_MAX
using namespace std;

stringstream tokens(stringstream::in | stringstream::out);

/* main
 *	f[n]:=2*f[n-1]+f[n-2]+f[n-3];
 *  * */

void decoder(const string& number, string& O) {
	stringstream decode(number);
	stringstream decode_out(stringstream::in | stringstream::out);
	stringstream decode_in(stringstream::in | stringstream::out);
	string I;
	unsigned long long num = 0;
	while (decode >> I) {
		decode_in.str("");
		decode_in.clear();
		decode_out.str("");
		decode_out.clear();
		decode_in << I;
		decode_in >> hex >> num;
		decode_out << num;
		decode_out >> I;
		O += I;
	} 
}

void encoder(const string& number, stringstream& encode_out) {
	stringstream encode_in(stringstream::in | stringstream::out);
	string I;
	unsigned long long num = 0;
	for(short p = 0; p < number.size();){
		short pos = 19;
		while(number[pos] == '0') pos--;
		I = number.substr(p, pos);
		encode_in.clear();
		encode_in.str("");

		encode_in << I;
		encode_in >> num;
		encode_out << hex << num;
		p += pos;
		if(p < number.size())
			encode_out << ' ';
	}
}

//Decode
///* 
int main() {
	string n;
	getline(cin, n);
	do {
		string O;
		decoder(n, O);
		cout << O << endl;
		getline(cin, n);
	} while(cin.eof() == false);
	return 0;
}
//*/
// Encode
/*
int main() {
	//unsigned long long x = 18446744073709551615;

	string n;
	stringstream encode_out(stringstream::in | stringstream::out);
	cin >> n;
	do {
		encode_out.clear();
		encode_out.str("");
		encoder(n, encode_out);
		cout << encode_out.str() << endl;
		cin >> n;
	} while(cin.eof() == false);
	//cout << numeric_limits<unsigned long long>::max() << endl;
	return 0;
}
*/
